import { Component, OnInit } from '@angular/core';
import {Hero} from "../mock-heroes";
import {HeroServiceService} from "../hero-service.service";

@Component({
  selector: 'app-dashboard',
  templateUrl: './dashboard.component.html',
  styleUrls: ['./dashboard.component.css'],
  providers:[HeroServiceService]
})
export class DashboardComponent implements OnInit {
  heroes:Hero[];
  constructor(private heroService:HeroServiceService) { }

  ngOnInit() {
    this.heroService.getHeros()
      .then(heroes => this.heroes = heroes.slice(1, 5));
  }

}
